<?php $this->load->view('qt/header'); ?>


<!--  PAPER WRAP -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">

        <!-- CONTENT -->
        <!--TITLE -->
        <div class="row">
            <div id="paper-top">
                <div class="col-sm-12">
                    <h2 class="tittle-content-header">
                        <i class="qt-network"></i>
                        <span id="title-header">
                            <?php echo (isset($this->title_header)) ? $this->title_header : 'TRANG CHÍNH';?>
                        </span>
                    </h2>
                </div>
            </div>
        </div>
        <!--/ TITLE -->
        <ul id="breadcrumb">
            <li><span class="entypo-home"></span></li>
            <li><i class="fa fa-lg fa-angle-right"></i></li>
            <li><a href="#main">Trang chủ</a></li>
        </ul>
        <div class="content-wrap"  style="margin-top: 10px;">
 
<section class="vbox" id="detail_customer" >
	<section class="scrollable">
		<section class="hbox stretch" style="background: white; float: left; padding: 5px !important; padding-top: 40px !important;">
			<aside class="col-lg-6 bg-light lter b-r">
				<section class="panel panel-success portlet-item" draggable="true" style="padding: 10px !important;" >
					<header class="panel-heading qthe" style="z-index: 2;">Khách hàng chính </header>
					<?php $result = $this->data["result"];?>
					<input id="cust_id" value="<?php echo $result["cust_id"]?>" type="hidden">
					<input id="cust_id_conflict" value="<?php echo $this->input->get("id")?>" type="hidden">
					<input id="data_type" value="<?php echo $this->input->get("type")?>" type="hidden">
					<div class=""  style="position: relative;">
						<section class="panel no-border bg-bla lt" >
							<div class="panel-body qtbo">
								<div class="clearfix text-center m-t">
									<div class="col-xs-12 text-center">
										<div class=""><!-- inline -->
											<!-- 
											<div style="width: 140px; height: 140px; line-height: 140px;margin: 0 auto;">
												<div class="thumb-lg avatar">
													<img src="/salesupport/images/avatar.png" class="dker">
												</div>
												<canvas width="140" height="140"></canvas>
											</div>

											-->
											<div class="col-xs-12 h4 m-t m-b-xs font-bold text-lt pointer  text-center" id="dt_first_name" style="padding-right: 5px;" data="cust_first_name">
												<?php echo $result["cust_first_name"]." ".$result["cust_last_name"];  ?>
											</div>

											<small class="text-muted m-b pointer " id="dt_address" data="cust_address">	
												<?php if($result["cust_address"]==""){ echo '......';}else{echo $result["cust_address"];}?>
											</small>
										</div>
									</div>
								</div>
								<div class="wrapper m-t m-b" style="width: 100%;">
									<input type="hidden" id="comp_id" value="">
									<div class="row m-b" style="width: 100%;">
										<div class="col-xs-12 text-right qtc">
                                         <div class="col-xs-4 text-right qtcc qtccl">
                                         Tênh doanh nghiệp
                                         </div>
                                         
                                         <div class="col-xs-8 text-right qtcc qtccr">
                                         <?php foreach($this->data["result_comp"] as $value){
													echo '<a href="'.base_url().'companies/detail?id='.$value['comp_id'].'" class=" pointer">'.$value['comp_name'].'</a><br>';
												}
											?>
                                         </div>
										</div>
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; width: 46%">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                         Ngày sinh
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_dob"]==""){ echo '......';}else{echo $result["cust_dob"];} ?>
                                         </div>
										</div>
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; float: right;">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-phone" style="list-style: none; float: left;">&nbsp;</li>
                                         Điện thoại
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_phone"]==""){ echo '......';}else{echo $result["cust_phone"];} ?>
                                         </div>
										</div>
                                        </div>
                                        
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; width: 46%">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-cmnd" style="list-style: none; float: left;">&nbsp;</li>
                                         CMND
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_cmnd"]==""){ echo '......';}else{echo $result["cust_cmnd"];} ?>
                                         </div>
										</div>
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; float: right;">
                                         <div class="col-xs-5 text-right qtcc qtccl">
                                         <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                         Ngày cấp
                                         </div>
                                         
                                         <div class="col-xs-7 text-right qtcc qtccr">
                                         <?php if($result["cust_cmnd_date"]==""){ echo '......';}else{echo $result["cust_cmnd_date"];} ?>
                                         </div>
										</div>
                                        </div>
                                        
                                       <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                           <div class="col-xs-8 text-right qtc" style="margin: 0px !important;">
                                             <div class="col-xs-3 text-right qtcc qtccl">
                                             <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                             Email
                                             </div>
                                             
                                             <div class="col-xs-9 text-right qtcc qtccr">
                                             <?php if($result["cust_email"]==""){ echo '......';}else{echo $result["cust_email"];} ?>
                                             </div>
    										</div>
                                        </div>
                                        
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                            <div class="col-xs-12 text-right qtc" style="margin: 0px !important;">
                                             <div class="col-xs-12 text-right qtcc qtccl">
                                             <li class="qt-money" style="list-style: none; float: left;">&nbsp;</li>
                                             Tài khoản ngân hàng
                                             </div>
                                             
                                             <div class="col-xs-12 text-right qtcc qtccr" style="border: 0px; border-top: 1px solid #bcbcbc;">
                                             <?php if($result["cust_bank_account"]==""){ echo '......';}else{echo $result["cust_bank_account"];}?>
                                             </div>
    										</div>
                                        </div>
                                        
                                        
									<div class="row m-b salem">
										<div class="col-xs-10 col-xs-offset-3 text-center" style="margin-left: 10% !important;">
                                        <div><small style="float: left; color: #424242; font-size: 16px; margin-top: 11px !important">Sale Quản lý</small></div>
											<div class="btn-group" style="float: right;"> 
											<span class="dropdown-toggle label bg-success spql"  data-toggle="dropdown">
                                            <?php echo $this->data["result_user"]["user_fullname"]?> </span>
											<!--
											<ul class="dropdown-menu pull-right text-left"> 
												<li><a href="<?php echo base_url()?>users/detail?id=<?php echo $this->data["result_user"]["user_id"]?>"><i class="fa fa-eye"></i> Xem hoạt động</a></li>

											</ul> 
													-->
											</div>
										</div>
									</div>
								</div>
							</div>
							
						</section>
					</div>
					<?php if(count($this->data["feed_result"])>0){?>
					<div class="time-wrap qtw" style="border: 1px solid red;">
                    <div class="row">
                        <div class="col-md-12">
                            <!-- The time line -->
                            <ul class="timeline">
							<?php 
								foreach($this->data["feed_result"] as $value):
									?>
                                    
                                    <li class="qtTi">
                                        <i class="fa bg-time" style="background: url('<?php echo base_url('public/theme/'.T); ?>/images/seo.png') !important;"></i>
                                        <div class="timeline-item">
                                            
                                            <span class="time" style="margin-left: 10px; color: #424242">
                                            <i class="qt-clock1" style="color: #424242;"></i> 
                                            <?php echo @date("h:i:s",$value["feed_action_time"]); ?></span>
                                            <span class="time"  style="color: #424242;"><i class="qt-time1" style="color: #424242;"></i> <?php echo @date("d/m/Y",$value["feed_action_time"]); ?></span>
                                            <h3 class="timeline-header"><a href="#" style="font-weight: bold;"><?php echo $this->session->userdata('fullname') ?></a> 
                                            <span style="margin: 0px 10px 0px 20px;">gặp khách hàng</span>
                                            <a class="mr" href="<?php echo base_url()?>customer/detail?id=<?php echo $value["cust_id"]?>"><?php echo $value["cust_first_name"]." ".$value["cust_last_name"]; ?></a>
                                            </h3>
                                            
                                            <div class="timeline-body" style="color: #808080;">
                                                <?php echo $value["feed_content"]?>
                                            </div>
                                        </div>
                                    </li>
							<?php endforeach; ?>
						      </ul>
                            </div>
                            </div>
						<?php if(count($this->data["feed_count_page"])>9){?>
						<section class="chat-list block">
								<article class="chat-item left">
									<div class="col-lg-12 text-center">
										<ul class="pagination pagination">
															<?php 
															$config['base_url'] = base_url().'conflict/review?id='.$_REQUEST["id"]."&cust";
															$config['total_rows'] = $this->data["feed_count_page"];
															$config['per_page'] = 10; 
															$config['page_query_string'] = TRUE;
															$config['full_tag_open'] = '<li>';
															$config['full_tag_close'] = '</li>';
															$config['last_tag_open'] = '<li>';
															$config['last_tag_close'] = '</li>';
															$config['next_tag_open'] = '<li>';
															$config['next_tag_close'] = '</li>';
															$config['prev_tag_open'] = '<li>';
															$config['prev_tag_close'] = '</li>';
															$config['cur_tag_open'] = '<li><a><b>';
															$config['cur_tag_close'] = '</b></a></li>';
															$config['num_tag_open'] = '<li>';
															$config['num_tag_close'] = '</li>';
															$this->pagination->initialize($config); 
															echo $this->pagination->create_links();
															?>

														</ul>
									</div>
								</article>
							</section>
							<?php }?>
					</div>
					<?php }?>
                    <div class="time-wrap qtw" style="border: 1px solid red; width: 100%; height: auto;">
                        <div class="padder-v"> 
                            <span class="m-b-xs h3 block text-white">
                            <a style="width: 100%;" onclick="accessChoneConflict(<?php echo $this->data["result_user"]["user_id"]?>,<?php echo $result["cust_id"]?>)" class="btn btn-s-md btn-success btnq">Cấp Quyền</a></span> 
                            <small class="text-muted"></small>
                        	</div>
                    </div>
				</section>
			</aside>
            
			<aside class="col-lg-6 bg-light lter b-r">
				<section class="panel panel-success portlet-item" draggable="true" style="padding: 10px !important;" >
					<header class="panel-heading qthe" style="z-index: 2;">Khách hàng conflict</header>
					<?php $result = $this->data["result_conflict"];?>
					<input id="cust_id" value="<?php echo $result["cust_id"]?>" type="hidden">
					<input id="cust_id_conflict" value="<?php echo $this->input->get("id")?>" type="hidden">
					<input id="data_type" value="<?php echo $this->input->get("type")?>" type="hidden">
					<div class=""  style="position: relative;">
						<section class="panel no-border bg-bla lt" >
							<div class="panel-body qtbo">
								<div class="clearfix text-center m-t">
									<div class="col-xs-12 text-center">
										<div class=""><!-- inline -->
											<!-- 
											<div style="width: 140px; height: 140px; line-height: 140px;margin: 0 auto;">
												<div class="thumb-lg avatar">
													<img src="/salesupport/images/avatar.png" class="dker">
												</div>
												<canvas width="140" height="140"></canvas>
											</div>

											-->
											<div class="col-xs-12 h4 m-t m-b-xs font-bold text-lt pointer  text-center" id="dt_first_name" style="padding-right: 5px;" data="cust_first_name">
												<?php echo $result["cust_first_name"]." ".$result["cust_last_name"];  ?>
											</div>

											<small class="text-muted m-b pointer " id="dt_address" data="cust_address">	
												<?php if($result["cust_address"]==""){ echo '......';}else{echo $result["cust_address"];}?>
											</small>
										</div>
									</div>
								</div>
								<div class="wrapper m-t m-b" style="width: 100%;">
									<input type="hidden" id="comp_id" value="">
									<div class="row m-b" style="width: 100%;">
										<div class="col-xs-12 text-right qtc">
                                         <div class="col-xs-4 text-right qtcc qtccl">
                                         Tênh doanh nghiệp
                                         </div>
                                         
                                         <div class="col-xs-8 text-right qtcc qtccr">
                                        <?php foreach($this->data["result_conflict_comp"] as $value){
													echo '<a href="'.base_url().'companies/detail?id='.$value['comp_id'].'" class=" pointer">'.$value['comp_name'].'</a><br>';
												}
											?>
                                         </div>
										</div>
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; width: 46%">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                         Ngày sinh
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_dob"]==""){ echo '......';}else{echo $result["cust_dob"];} ?>
                                         </div>
										</div>
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; float: right;">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-phone" style="list-style: none; float: left;">&nbsp;</li>
                                         Điện thoại
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_phone"]==""){ echo '......';}else{echo $result["cust_phone"];} ?>
                                         </div>
										</div>
                                        </div>
                                        
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; width: 46%">
                                         <div class="col-xs-6 text-right qtcc qtccl">
                                         <li class="qt-cmnd" style="list-style: none; float: left;">&nbsp;</li>
                                         CMND
                                         </div>
                                         
                                         <div class="col-xs-6 text-right qtcc qtccr">
                                         <?php if($result["cust_cmnd"]==""){ echo '......';}else{echo $result["cust_cmnd"];} ?>
                                         </div>
										</div>
                                        
                                        <div class="col-xs-6 text-right qtc" style="margin: 0px !important; float: right;">
                                         <div class="col-xs-5 text-right qtcc qtccl">
                                         <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                         Ngày cấp
                                         </div>
                                         
                                         <div class="col-xs-7 text-right qtcc qtccr">
                                         <?php if($result["cust_cmnd_date"]==""){ echo '......';}else{echo $result["cust_cmnd_date"];} ?>
                                         </div>
										</div>
                                        </div>
                                        
                                       <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                           <div class="col-xs-8 text-right qtc" style="margin: 0px !important;">
                                             <div class="col-xs-3 text-right qtcc qtccl">
                                             <li class="qt-time1" style="list-style: none; float: left;">&nbsp;</li>
                                             Email
                                             </div>
                                             
                                             <div class="col-xs-9 text-right qtcc qtccr">
                                             <?php if($result["cust_email"]==""){ echo '......';}else{echo $result["cust_email"];} ?>
                                             </div>
    										</div>
                                        </div>
                                        
                                        <div class="col-xs-12 text-right qtc qtk" style="border: none !important;">
                                            <div class="col-xs-12 text-right qtc" style="margin: 0px !important;">
                                             <div class="col-xs-12 text-right qtcc qtccl">
                                             <li class="qt-money" style="list-style: none; float: left;">&nbsp;</li>
                                             Tài khoản ngân hàng
                                             </div>
                                             
                                             <div class="col-xs-12 text-right qtcc qtccr" style="border: 0px; border-top: 1px solid #bcbcbc;">
                                             <?php if($result["cust_bank_account"]==""){ echo '......';}else{echo $result["cust_bank_account"];}?>
                                             </div>
    										</div>
                                        </div>
                                        
                                        
									<div class="row m-b salem">
										<div class="col-xs-10 col-xs-offset-3 text-center" style="margin-left: 10% !important;">
                                        <div><small style="float: left; color: #424242; font-size: 16px; margin-top: 11px !important">Sale Quản lý</small></div>
											<div class="btn-group" style="float: right;"> 
											<span class="dropdown-toggle label bg-success spql"  data-toggle="dropdown">
                                            <?php echo $this->data["result_conflict_user"]["user_fullname"]?> </span>
											<!--
											<ul class="dropdown-menu pull-right text-left"> 
												<li><a href="<?php echo base_url()?>users/detail?id=<?php echo $this->data["result_conflict_user"]["user_id"]?>"><i class="fa fa-eye"></i> Xem hoạt động</a></li>

											</ul> 
													-->
											</div>
										</div>
									</div>
								</div>
							</div>
							
						</section>
					</div>
					<?php if(count($this->data["feed_result"])>0){?>
					<div class="time-wrap qtw" style="border: 1px solid red;">
                    <div class="row">
                        <div class="col-md-12">
                            <!-- The time line -->
                            <ul class="timeline">
							<?php 
								foreach($this->data["feed_conflict_result"] as $value):
									?>
                                    
                                    <li class="qtTi">
                                        <i class="fa bg-time" style="background: url('<?php echo base_url('public/theme/'.T); ?>/images/seo.png') !important;"></i>
                                        <div class="timeline-item">
                                            
                                            <span class="time" style="margin-left: 10px; color: #424242">
                                            <i class="qt-clock1" style="color: #424242;"></i> 
                                            <?php echo @date("h:i:s",$value["feed_action_time"]); ?></span>
                                            <span class="time"  style="color: #424242;"><i class="qt-time1" style="color: #424242;"></i> <?php echo @date("d/m/Y",$value["feed_action_time"]); ?></span>
                                            <h3 class="timeline-header"><a href="#" style="font-weight: bold;"><?php echo $this->session->userdata('fullname') ?></a> 
                                            <span style="margin: 0px 10px 0px 20px;">gặp khách hàng</span>
                                            <a class="mr" href="<?php echo base_url()?>customer/detail?id=<?php echo $value["cust_id"]?>"><?php echo $value["cust_first_name"]." ".$value["cust_last_name"]; ?></a>
                                            </h3>
                                            
                                            <div class="timeline-body" style="color: #808080;">
                                                <?php echo $value["feed_content"]?>
                                            </div>
                                        </div>
                                    </li>
							<?php endforeach; ?>
						      </ul>
                            </div>
                            </div>
						<?php if(count($this->data["feed_count_page"])>9){?>
						<section class="chat-list block">
								<article class="chat-item left">
									<div class="col-lg-12 text-center">
										<ul class="pagination pagination">
															<?php 
															$config['base_url'] = base_url().'conflict/review?id='.$_REQUEST["id"]."&cust";
															$config['total_rows'] = $this->data["feed_count_page"];
															$config['per_page'] = 10; 
															$config['page_query_string'] = TRUE;
															$config['full_tag_open'] = '<li>';
															$config['full_tag_close'] = '</li>';
															$config['last_tag_open'] = '<li>';
															$config['last_tag_close'] = '</li>';
															$config['next_tag_open'] = '<li>';
															$config['next_tag_close'] = '</li>';
															$config['prev_tag_open'] = '<li>';
															$config['prev_tag_close'] = '</li>';
															$config['cur_tag_open'] = '<li><a><b>';
															$config['cur_tag_close'] = '</b></a></li>';
															$config['num_tag_open'] = '<li>';
															$config['num_tag_close'] = '</li>';
															$this->pagination->initialize($config); 
															echo $this->pagination->create_links();
															?>

														</ul>
									</div>
								</article>
							</section>
							<?php }?>
					</div>
					<?php }?>
                    <div class="time-wrap qtw" style="border: 1px solid red; width: 100%; height: auto;">
                        <div class="padder-v"> 
                            <span class="m-b-xs h3 block text-white">
                            <a style="width: 100%;" onclick="accessChoneConflict(<?php echo $this->data["result_conflict_user"]["user_id"]?>,<?php echo $result["cust_id"]?>)" class="btn btn-s-md btn-success btnq">Cấp Quyền</a></span> 
                            <small class="text-muted"></small>
                        	</div>
                    </div>
				</section>
			</aside>
            
		</section>
	</section>
</section>  
        
</div>
<div class="content-wrap" id="show-content2"></div>
<div class="content-wrap"> 
<?php $this->load->view('qt/footer'); ?>